package sg.edu.nus.iss.vmcs.store;

/*
 * Copyright 2011 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

import java.io.*;

/**
 * This interface provides the generic functionality required to initialise 
 * the stores. 
 * @version 1.0  07/12/2011
 * @author Team 7S - SE19
 */
public interface IStoreLoader {
	
    /**
     * This operation reads the properties file into a hash table. 
     * @throws java.io.IOException
     */
	public void initialize() throws IOException;
	
        
        /**
         * This operation writes the properties from the hash table to the file. 
         * @throws java.io.IOException
         */
	public void save() throws IOException; 

        /**
         * This operation returns the number of items (either Cash Store Items 
         * or Drink Store Items) stored in the hash table. 
         * @return the number of items (either Cash Store Items 
         * or Drink Store Items)
         */
	public int getNumOfItems();

        /**
         * This operation sets the number of items (either Cash Store Items or 
         * Drink Store Items) stored in the hash table. 
         * @param numItems the integer value that determines the number of items.
         */
	public void setNumOfItems(int numItems);

        /**
         * This operation reads data from the hash table and creates a StoreItem. 
         * @param index the position of the StoreItem in the hash table.
         * @return returns the StoreItem.
         */
	public String getValue (String key);

        /**
         * This operation updates the hash table with data from the StoreItem. 
         * @param index the position value of the StoreItem in the hash table.
         * @param item the StoreItem that needs to be set.
         */
	public void setValue (String key, String value);

}
